package com.aloha.springframework.beans.factory.support;

import com.aloha.springframework.beans.BeansException;
import com.aloha.springframework.beans.factory.config.BeanDefinition;

import java.lang.reflect.Constructor;

/**
 * @author DaiZhiHeng
 * @description 创建对象的策略接口
 * @date 2023/6/27 21:10
 */

public interface InstantiationStrategy {

    /**
     * 创建对象
     *
     * @param beanName       Bean在容器中的名字
     * @param beanDefinition Bean定义信息
     * @param constructor    构造器对象
     * @param args           构造参数
     */
    Object instantiate(String beanName, BeanDefinition beanDefinition, Constructor<?> constructor, Object[] args) throws BeansException;

}
